package org.anupta.game.server.game.packet.other;

import org.anupta.game.main.Main;
import org.anupta.game.server.game.client.GameClient;
import org.anupta.game.server.game.packet.GamePacket;

public class Message extends GamePacket {
	private String message = null;
	private String color = null;

	public Message(GameClient client, String message, String color) {
		super(client);
		this.message = message;
		this.color = color;
		pack();
		doPacket();
	}

	@Override
	public void unpack() {
	}

	@Override
	public void pack() {
		packetOut.append("cs<font color='#").append(color).append("'>").append(message).append("</font>");
	}

	@Override
	public void doPacket() {
		client.send(packetOut.toString());
		Main.out.println(new StringBuilder("Message sended to : ").append(client.getIp()).toString());
	}

}
